package com.member.mp.config;

import com.member.common.utils.RedisUtils;
import org.redisson.api.RBlockingQueue;
import org.redisson.api.RDelayedQueue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @date 2024/8/30 15:05
 */
@Configuration
public class RedissonQueueConfig {

    @Bean
    public RBlockingQueue<String> blockingQueue() {
        String queueName = "orderQueue";
        return RedisUtils.getClient().getBlockingQueue(queueName);
    }

    @Bean
    public RDelayedQueue<String> delayedQueue(RBlockingQueue<String> blockQueue) {
        return RedisUtils.getClient().getDelayedQueue(blockQueue);
    }
}
